package edu.hitsz.prop;

import edu.hitsz.aircraft.AbstractAircraft;
import edu.hitsz.application.Main;
import edu.hitsz.application.MusicThread;

/**
 * 加血道具
 * @author CsCN
 */
public class BloodProp extends AbstractProp {

    /**
     * 加血量
     */
    private final int hp = 200;

    public BloodProp(int locationX, int locationY, int speedX, int speedY) {
        super(locationX, locationY, speedX, speedY);
    }

    @Override
    public int acquireProp(AbstractAircraft hero) {
        if (Main.musicFlag) {
            new MusicThread("get_supply.wav", false).start();
        }
        //减负血等于加血 没有再写一个函数 没有考虑潜在的溢出风险
        hero.decreaseHp(-hp);
        return 0;
    }

    public int getHp(){
        return hp;
    }

}
